package top.hkyzf.study.leetcode.array;

import org.junit.Test;

/**
 * description: 
 * @author zhufeng
 * @date 2024/4/9 0009 10:27
 * @version V1.0
 */
public class 正整数和负整数的最大计数_2529 {
    public int maximumCount(int[] nums) {
        int pos = 0, neg = 0;
        for (int num : nums) {
            if (num < 0) {
                neg++;
            } else if (num > 0){
                pos++;
            }
        }
        return Math.max(neg, pos);
    }

    @Test
    public void testMaximumCount () {
        int[] nums = {-2,-1,-1,1,2,3};
        System.out.println(maximumCount(nums));
    }
}

